package com.uchengwang.ui.base_ui.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.widget.DrawerLayout;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ExpandableListView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.flyco.tablayout.CommonTabLayout;
import com.flyco.tablayout.listener.CustomTabEntity;
import com.flyco.tablayout.listener.OnTabSelectListener;
import com.flyco.tablayout.widget.MsgView;
import com.uchengwang.R;
import com.uchengwang.functions.http.config.BaseConfig;
import com.uchengwang.functions.image.ImageManager;
import com.uchengwang.functions.jpush.JpushSetAlisTagUtil;
import com.uchengwang.ui.UChengApplication;
import com.uchengwang.ui.base_ui.basefm.FragmentTalent;
import com.uchengwang.ui.base_ui.basefm.FragmentUMe;
import com.uchengwang.ui.base_ui.basefm.FragmentUU;
import com.uchengwang.ui.base_ui.bean.TabEntity;
import com.uchengwang.ui.cm_ui.cycle.adapter.MainExListAdapter;
import com.uchengwang.ui.cm_ui.cycle.bean.MainExListBean;
import com.uchengwang.ui.cm_ui.cycle.ui.LoadCycleWebHtmlActivity;
import com.uchengwang.ui.cm_ui.login.LoginHttp.LoginHttpManager;
import com.uchengwang.ui.cm_ui.rychat.manager.RongChatManager;
import com.uchengwang.ui.cm_ui.ucity.presenter.HttpCityPresenter;
import com.uchengwang.ui.cm_ui.ucity.ui.QRCodeShowActivity;
import com.uchengwang.ui.cm_ui.uu.adapter.SlideLeftAdapter;
import com.uchengwang.ui.cm_ui.uu.bean.SlideBean;
import com.uchengwang.ui.utils.SPUtils;
import com.uchengwang.ui.utils.StatusBarUtil;
import com.uchengwang.ui.utils.UCommonUtil;
import com.umeng.analytics.MobclickAgent;

import java.util.ArrayList;
import java.util.List;

import cn.jpush.android.api.JPushInterface;
import de.greenrobot.event.EventBus;
import io.rong.imkit.RongIM;
import io.rong.imkit.manager.IUnReadMessageObserver;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation;


/**
 * 首页的activity
 */
public class MainActivity extends AllBaseActivity implements IUnReadMessageObserver, View.OnClickListener {
    public static boolean isForeground = false;//极光推送
    public static final String MESSAGE_RECEIVED_ACTION = "com.example.jpushdemo.MESSAGE_RECEIVED_ACTION";
    public static final String KEY_MESSAGE = "message";
    public static final String KEY_EXTRAS = "extras";
    public static boolean isResumeChange = false;//未登录 跳转到登录界面也未登录 在返回主界面

    // 定义数组来存放Fragment界面
    private Fragment[] fragments = null;
//    private FragmentCycleMain cycle;
    private FragmentTalent talent;
    private FragmentUU uu;
    private FragmentUMe uMe;
    // 定义数组来存放选中按钮图片
    private final int mImgSelect[] = {
            R.drawable.club_circle_tab_pressed,
            R.drawable.msg_tab_pressed,
            R.drawable.umy_tab_pressed};

    // 定义数组来存放未选中按钮图片
    private final int mImgUnSelect[] = {
            R.drawable.club_circle_tab_normal,
            R.drawable.msg_tab_normal,
            R.drawable.umy_tab_normal};

    // Tab选项卡的文字
    private final String mTabTitle[] = {"达人", "消息", "我"};
    private ArrayList<CustomTabEntity> mTabData = new ArrayList<>();
    {
        for (int i = 0; i < mTabTitle.length; i++) {
            mTabData.add(new TabEntity(mTabTitle[i], mImgSelect[i], mImgUnSelect[i]));
        }
    }
    private long reFreshTime;//刷新时间

    private DrawerLayout main_drawer;
    private RelativeLayout main_right_rl;
    private LinearLayout main_left_ln, slide_ln;
    private CommonTabLayout ctl_main_tab;
    private ImageView main_guide_bg;

    private int currentIndex, preIndex;//当前的fragment角标 切换到当前角标的上一个角标
    private ImageView slide_head, slide_erweima, main_bg;
    private TextView slide_name, slide_sign;
    private ListView slide_lv;
    private List<SlideBean> slideBeanList;

    private SlideLeftAdapter slideLeftAdapter;

    private View msgLeft, cycleLeft;
    private LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        isInitMode = false;//加载的状态栏字体颜色为白色

        super.onCreate(savedInstanceState);
        currentIndex = getIntent().getIntExtra(BaseConfig.INDEX, 0);
        talent = new FragmentTalent();
        uu = new FragmentUU();
        uMe = new FragmentUMe();
        fragments = new Fragment[]{talent, uu, uMe};
        EventBus.getDefault().register(this);

        setContentView(R.layout.activity_main);
        StatusBarUtil.getUtil().setTransparencyBar(this);
        initView();
        initData();
    }

    private void initView(){
//        main_drawer = (DrawerLayout) findViewById(R.id.main_drawer);
        main_bg = (ImageView) findViewById(R.id.main_bg);
        main_right_rl = (RelativeLayout) findViewById(R.id.activity_main_right_rl);
//        main_left_ln = (LinearLayout) findViewById(R.id.main_left_ln);
        ctl_main_tab = (CommonTabLayout) findViewById(R.id.ctl_main_tab);
//        main_guide_bg = (ImageView) findViewById(R.id.main_guide_bg);

        ImageManager.getInstance().loadImage(this, main_bg, R.drawable.image_main_bg, ImageManager.ImageType.NARMOL);

//        slide_ln = (LinearLayout) findViewById(R.id.slide_ln);
//        slide_head = (ImageView) findViewById(R.id.slide_head);
//        slide_name = (TextView) findViewById(R.id.slide_name);
//        slide_erweima = (ImageView) findViewById(R.id.slide_erweima);
//        slide_sign = (TextView) findViewById(R.id.slide_sign);
//        slide_lv = (ListView) findViewById(R.id.slide_lv);
//        slide_ln.setOnClickListener(this);
//        slide_erweima.setOnClickListener(this);


        ctl_main_tab.setNoTitleImageSize(70);
        ctl_main_tab.setTabData(mTabData);

        ctl_main_tab.setOnTabSelectListener(new OnTabSelectListener() {
            @Override
            public void onTabSelect(int position) {
                changeFragment(position);
            }
            @Override
            public void onTabReselect(int position) {
            }
        });

//        main_drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);//设置不能侧滑
//        cycleLeftView();//首先加载社圈的界面
//        main_drawer.setDrawerListener(new DrawerLayout.DrawerListener() {
//            @Override
//            public void onDrawerSlide(View drawerView, float slideOffset) {
//                //获取屏幕的宽高
////                DisplayMetrics display = DensityUtil.getUtil().dueDisplayMetrics(MainActivity.this);
////                //设置右面的布局位置  根据左面菜单的right作为右面布局的left   左面的right+屏幕的宽度（或者right的宽度这里是相等的）为右面布局的right
////                main_right_rl.layout(main_left_ln.getRight(), 0, main_left_ln.getRight() + display.widthPixels, display.heightPixels);
//            }
//            @Override
//            public void onDrawerOpened(View drawerView) {
//                if (currentIndex ==1){
//                    loadLeftData();
//                }
//            }
//            @Override
//            public void onDrawerClosed(View drawerView) {
//            }
//            @Override
//            public void onDrawerStateChanged(int newState) {
//                switch (newState) {
//                    case DrawerLayout.STATE_DRAGGING://滑动的时候
//                        break;
//                    case DrawerLayout.STATE_IDLE://闲置的时候
//                        break;
//                    case DrawerLayout.STATE_SETTLING://自动移动的时候
//                        break;
//                }
//            }
//        });
    }

    private void initData(){
        setJPush();
        //检查版本更新
        HttpCityPresenter.getPresenter().sysVersion(MainActivity.this, UCommonUtil.getUtil().GetVersion(MainActivity.this));
        LoginHttpManager.getManager().downloadMyFriends(MainActivity.this);
        LoginHttpManager.getManager().downloadMyGroups(MainActivity.this);

        final Conversation.ConversationType[] conversationTypes = {Conversation.ConversationType.PRIVATE, Conversation.ConversationType.GROUP};
        RongIM.getInstance().addUnReadMessageCountChangedObserver(this, conversationTypes);

//        slideBeanList = new ArrayList<>();
//        slideBeanList.add(new SlideBean(2, R.drawable.icon_slide_atten, "关注", 0, 0));
//        slideBeanList.add(new SlideBean(1, R.drawable.icon_slide_fans, "粉丝", 0, 0));
//        slideBeanList.add(new SlideBean(3, R.drawable.icon_slide_friends, "好友", 0, 0));
//        slideBeanList.add(new SlideBean(4, R.drawable.icon_slide_group, "群组", 0, 0));
//        slideBeanList.add(new SlideBean(0, R.drawable.icon_slide_contact, "通讯录好友", 0, 0));
//
//        slideLeftAdapter = new SlideLeftAdapter(this, slideBeanList);
//        slide_lv.setAdapter(slideLeftAdapter);
    }

    //加载滑动出来的左侧的view数据
    private void loadLeftData(){
        if(!TextUtils.isEmpty(UChengApplication.userAvatar)){
            ImageManager.getInstance().loadImage(this, slide_head, UChengApplication.userAvatar, ImageManager.ImageType.CIRCLE);
            slide_name.setText(UChengApplication.nickName);
            slide_sign.setText(SPUtils.getPreferences(this).getString(BaseConfig.USER_SIGN));
        }else {
            ImageManager.getInstance().loadImage(this, slide_head, R.drawable.no_head, ImageManager.ImageType.CIRCLE);
            slide_name.setHint("点击登录");
        }
    }

    private void setJPush(){
        //极光设置alis
        if (UCommonUtil.getUtil().getId() >0){//登录状态 设置alis
            if (JPushInterface.isPushStopped(this)){
                JPushInterface.resumePush(this);
            }else {
                JpushSetAlisTagUtil.getUtil().setAlis(this);
            }
        }else {
            //未登录
            JpushSetAlisTagUtil.getUtil().setNullAlis(this);
        }
        //设置tag
        JpushSetAlisTagUtil.getUtil().setClubTags(this);
    }


    /**
     * 当在消息界面时 打开左侧的界面
     * */
    private void msgLeftView(){
        if (msgLeft == null){
            msgLeft = LayoutInflater.from(this).inflate(R.layout.layout_activity_main_left, null);
            slide_ln =  msgLeft.findViewById(R.id.slide_ln);
            slide_head =  msgLeft.findViewById(R.id.slide_head);
            slide_name =  msgLeft.findViewById(R.id.slide_name);

            slide_erweima =  msgLeft.findViewById(R.id.slide_erweima);
            slide_sign =  msgLeft.findViewById(R.id.slide_sign);
            slide_lv =  msgLeft.findViewById(R.id.slide_lv);

            slide_ln.setOnClickListener(this);
            slide_erweima.setOnClickListener(this);

            slideBeanList = new ArrayList<>();
            slideBeanList.add(new SlideBean(2, R.drawable.icon_slide_atten, "关注", 0, 0));
            slideBeanList.add(new SlideBean(1, R.drawable.icon_slide_fans, "粉丝", 0, 0));
            slideBeanList.add(new SlideBean(3, R.drawable.icon_slide_friends, "好友", 0, 0));
            slideBeanList.add(new SlideBean(4, R.drawable.icon_slide_group, "群组", 0, 0));
            slideBeanList.add(new SlideBean(0, R.drawable.icon_slide_contact, "通讯录好友", 0, 0));

            slideLeftAdapter = new SlideLeftAdapter(this, slideBeanList);
            slide_lv.setAdapter(slideLeftAdapter);
        }

        main_left_ln.removeAllViews();
        main_left_ln.addView(msgLeft, params);
    }

    /**
     * 当在社圈界面时 打开的左侧界面
     * */
    private void cycleLeftView(){
        if (cycleLeft == null){
            cycleLeft = LayoutInflater.from(this).inflate(R.layout.layout_activity_cycle_main_left, null);
            ExpandableListView main_exLv = cycleLeft.findViewById(R.id.main_exLv);

            List<MainExListBean> listBeans = new ArrayList<>();

            List<String> stringList = new ArrayList<>();
            stringList.add("旅游");
            stringList.add("篮球");
            stringList.add("音乐");
            stringList.add("读书");

            List<String> stringList2 = new ArrayList<>();
            stringList2.add("旅游");
            stringList2.add("篮球");
            stringList2.add("音乐");
            stringList2.add("读书");
            stringList2.add("创业");
            stringList2.add("骑行");
            stringList2.add("电动");

            MainExListBean bean = new MainExListBean();
            MainExListBean bean2 = new MainExListBean();
            MainExListBean bean3 = new MainExListBean();
            MainExListBean bean4 = new MainExListBean();

            bean.setTitle("旅游1");
            bean.setStringList(stringList);
            listBeans.add(bean);

            bean2.setTitle("旅游2");
            bean2.setStringList(stringList2);
            listBeans.add(bean2);

            bean3.setTitle("旅游3");
            bean3.setStringList(stringList);
            listBeans.add(bean3);

            bean4.setTitle("旅游4");
            bean4.setStringList(stringList2);
            listBeans.add(bean4);

            MainExListAdapter adapter = new MainExListAdapter(this);
            main_exLv.setAdapter(adapter);
            adapter.setData(listBeans);
        }

        main_left_ln.removeAllViews();
        main_left_ln.addView(cycleLeft, params);
    }


    @Override
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        getSupportFragmentManager().beginTransaction().replace(R.id.realtabcontent, fragments[currentIndex]).commit();
        ctl_main_tab.setCurrentTab(currentIndex);

        meGuideView(currentIndex);
    }

    /**
     * 点击将左侧的菜单调出来
     * */
//    public void openDrawerLayout(){
//        if (main_drawer != null && !main_drawer.isDrawerOpen(GravityCompat.START)){
//            main_drawer.openDrawer(GravityCompat.START);
//        }
//    }

    private void changeFragment(int position){
//        if (position ==1){
//            main_drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
//        }else {
//            main_drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
//        }

        //当需要社圈首页第一页左滑在放开
//        if (position ==0){
////            cycleLeftView();
//        }else if (position ==1){
//            msgLeftView();
//        }

        //不会重复实例化fragment
        if (currentIndex != position) {
//            if(position ==1){
//                //切换到UU的界面 未登录状态
//                if (UCommonUtil.getUtil().isNeedLogin(this, false)){
//                    preIndex = currentIndex;
//                    currentIndex = position;
//                    return;
//                }
//            }

            FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
            if (!fragments[position].isAdded()) {    // 先判断是否被add过
                transaction.hide(fragments[currentIndex]).add(R.id.realtabcontent, fragments[position]).commit(); // 隐藏当前的fragment，add下一个到Activity中
            } else {
                transaction.hide(fragments[currentIndex]).show(fragments[position]).commit(); // 隐藏当前的fragment，显示下一个
            }
            preIndex = currentIndex;
            currentIndex = position;

            //如果position等于我的界面 判断引导图有没有加载过
            meGuideView(position);
        }
    }

    //判断我的引导图
    //引导图
    private void meGuideView(int index){
    }

    /**
     * 隐藏某个Fragment所在角标的红点
     * */
    public void hideDot(int index){
        ctl_main_tab.hideMsg(index);
    }
    /**
     * 显示某个Fragment所在角标的红点
     * */
    public void showDot(int index){
        ctl_main_tab.showDot(index);
    }

    /**
     * 隐藏Tab
     * */
    public void hideTab(){
        ctl_main_tab.setVisibility(View.GONE);
    }

    /**
     * 隐藏Tab
     * */
    public void showTab(){
        ctl_main_tab.setVisibility(View.VISIBLE);
    }

    /**
     * 获取当前Fragment角标的未读消息数
     * */
    public int getNoReadMsg(int index){
        MsgView view = ctl_main_tab.getMsgView(index);
        String msgNum = view.getText().toString();
        if (TextUtils.isEmpty(msgNum)){
            return -1;
        }
        return Integer.valueOf(msgNum);
    }

    /**
     * 收到EventBus信息
     * */
    public void onEvent(Boolean isRefresh) {
        if (isRefresh != null && isRefresh){
            if (uu != null  && uu.getActivity() != null && !uu.getActivity().isFinishing()) {
                uu.initData(true);
            }
        }
    }

    /**
     * 收到极光推动的消息时, 粉丝 好友 关注等 刷新自己的关系数量 和新粉丝数量
     * */
    public void onEvent(String friendType) {
        if (!TextUtils.isEmpty(friendType)){
            switch (friendType){
                case BaseConfig.NEW_FANS:
                case BaseConfig.FRIENDS:
                    if (uMe != null  && uMe.getActivity() != null && !uMe.getActivity().isFinishing()) {
                        uMe.getMyUsers();
                    }
                    break;

                case BaseConfig.EVENT_CANCEL:
//                    refreshFans(1, 0);
                    break;

                case BaseConfig.CYCLE_JOIN://新用户申请加入社圈  需要刷新社圈主页
                case BaseConfig.CYCLE_JOIN_RESULT://申请社圈 审核结果 也需要刷新社圈主页
                case BaseConfig.RELEASE_CYCLE_SUCCESS://自己创建了社圈
//                    if (cycle != null  && cycle.getActivity() != null && !cycle.getActivity().isFinishing()) {
//                        cycle.getCreateAndJoinCycles();
//                    }
                    break;
            }
        }
    }

    @Override
    public void onCountChanged(int count) {
        if (UCommonUtil.getUtil().isLogin()){
            if (count > 0) {
                ctl_main_tab.showMsg(1, count);
            } else {
                ctl_main_tab.hideMsg(1);
            }
        }else {
            ctl_main_tab.hideMsg(1);
        }
    }

    @Override
    protected void onResume() {
        super.onResume();

        //如果没登录 跳转到角标0 或者1,3
//        if (!UCommonUtil.getUtil().isLogin() && isResumeChange){
//            if (currentIndex ==1){
//                getSupportFragmentManager().beginTransaction().hide(fragments[currentIndex]).show(fragments[preIndex]).commit();
//                ctl_main_tab.setCurrentTab(preIndex);
//                currentIndex = preIndex;
//            }else {
//                getSupportFragmentManager().beginTransaction().hide(fragments[currentIndex]).show(fragments[currentIndex]).commit();
//                ctl_main_tab.setCurrentTab(currentIndex);
//            }
//        }

        if (UChengApplication.isAccountChange){
            if (uu != null  && uu.getActivity() != null) {
                uu.refresh();
            }
        }

        /**
         * 每隔一定的时间去查看享说和我的界面有没有消息更新
         * */
//        if (UCommonUtil.getUtil().isLogin() && (System.currentTimeMillis()- reFreshTime)/1000/60 >5){
//            getUnReadMsg();
//        }

        MobclickAgent.onResume(this);
        isForeground = true;

        //检查融云连接情况
        if (UCommonUtil.getUtil().isLogin() && (RongIM.getInstance().getCurrentConnectionStatus() == RongIMClient.ConnectionStatusListener.ConnectionStatus.DISCONNECTED
                || RongIM.getInstance().getCurrentConnectionStatus() == RongIMClient.ConnectionStatusListener.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT)){
            RongChatManager.getUtils().getTokenAdnLink(this, null);
        }
    }

    @Override
    protected void onPause() {
        super.onPause();
        MobclickAgent.onPause(this);
        isForeground = false;
        BaseConfig.isRelease = false;
    }

    @Override
    protected void onStop() {
        super.onStop();
        isResumeChange = false;
        UChengApplication.isAccountChange = false;
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
        RongIM.getInstance().removeUnReadMessageCountChangedObserver(this);
//        if (main_drawer != null && main_drawer.isDrawerOpen(GravityCompat.START)){
//            main_drawer.closeDrawer(GravityCompat.START);
//        }
    }

    /**
     * 我的界面 获取享说和我的未读消息
     * U社界面 获取享说的未读消息
     * */
//    private void getUnReadMsg(){
//        getMyUsers();
//        reFreshTime = System.currentTimeMillis();
//    }

    /**
     * 获取自己的粉丝 关注 好友数
     * */
    private void getMyUsers(){
//        HttpMeManager.getPresenter().checkMyCount(this, new HttpMeManager.CheckMyCountListener() {
//            @Override
//            public void onResult(int fans, int follow, int friend) {
//                if (slideLeftAdapter != null){
//                    List<SlideBean> list = slideLeftAdapter.getList();
//                    for (SlideBean bean : list){////1粉丝  2关注 3好友 4群组
//                        int type = bean.getType();
//                        if (type ==1){
//                            bean.setNum(fans);
//                        }else if (type ==2){
//                            bean.setNum(follow);
//                        }else if (type ==3){
//                            bean.setNum(friend);
//                        }
//                    }
//                    getMyGroups(list);
//                }
//            }
//        });

        //获取我的界面的通知更新
//        HttpUserManager.getManager().getMyNotice(this, 1, 1, false, false, new OnHttpResultListener<NoticeBean>() {
//            @Override
//            public void onResult(int status, String msg, int total, List<NoticeBean> list) {
//                if (list != null){
//                    if (uMe != null && uMe.getActivity() != null){
//                        uMe.updateAdapter("通知", true);
//                        ctl_main_tab.showMsg(2, 0);
//                    }
//                }
//            }
//        });




    }

    /**
     * 更新我的粉丝
     * @param changeType 1粉丝  2关注 3好友 4群组
     * */
//    public void refreshFans(int changeType, int fans){
//        if (slideLeftAdapter != null){
//            List<SlideBean> list = slideLeftAdapter.getList();
//            for (SlideBean bean : list){////1粉丝  2关注 3好友 4群组
//                int type = bean.getType();
//                if (type ==changeType){
//                    bean.setHveNoRead(fans);
//                    break;
//                }
//            }
//            slideLeftAdapter.setList(list);
//        }
//    }

    /**
     * 获取我的群组信息
     * */
    private void getMyGroups(final List<SlideBean> lists){
//        RyGroupManager.getManager().getMyGroups(this, 1,1, 0, new OnHttpResultListener<RyGroupBean>() {
//            @Override
//            public void onResult(int status, String msg, int total, List<RyGroupBean> list) {
//                for (SlideBean bean : lists){////1粉丝  2关注 3好友 4群组
//                    int type = bean.getType();
//                    if (type ==4){
//                        bean.setNum(total);
//                    }
//                }
//                slideLeftAdapter.setList(lists);
//            }
//        });
    }

    /**
     * 退出程序但不销毁
     * 参数为false——代表只有当前activity是task根，指应用启动的第一个activity时，才有效;
        参数为true——则忽略这个限制，任何activity都可以有效。
     * */
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
//            if (main_drawer.isDrawerOpen(GravityCompat.START)){
//                main_drawer.closeDrawer(GravityCompat.START);
//            }else {
//                moveTaskToBack(true);
//            }
            moveTaskToBack(true);
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }

    @Override
    public void onClick(View v) {
        if (UCommonUtil.getUtil().isNeedLogin(MainActivity.this, false)){
            return;
        }
        Intent intent = null;
        switch (v.getId()){
            case R.id.slide_ln://进入我的主页
                intent = new Intent(this, LoadCycleWebHtmlActivity.class);
                intent.putExtra(BaseConfig.URL, BaseConfig.BaseWebURL + "/user/"+UCommonUtil.getUtil().getId());
                break;
            case R.id.slide_erweima://点击进入我的二维码界面
                intent = new Intent(this, QRCodeShowActivity.class);
                intent.putExtra(BaseConfig.TYPE, 1);
                intent.putExtra(BaseConfig.ID, UCommonUtil.getUtil().getId());
                break;
        }
        if (intent != null){
            startActivity(intent);
        }
    }

}
